import request from '@/utils/request'

export function addForm(data) {
  return request({
    url: '/api/flowable/form',
    method: 'post',
    data
  })
}

// 查询流程表单列表
export function listForm(params) {
  return request({
    url: '/api/flowable/form',
    method: 'get',
    params
  })
}

// 查询流程表单详细
export function getForm(formId) {
  return request({
    url: '/api/flowable/form/' + formId,
    method: 'get'
  })
}

export function del(ids) {
  return request({
    url: '/api/flowable/form/',
    method: 'delete',
    data: ids
  })
}

export function editForm(data) {
  return request({
    url: '/api/flowable/form',
    method: 'put',
    data
  })
}
// 导出流程表单
export function exportForm(params) {
  return request({
    url: '/api/flowable/form/download',
    method: 'get',
    params
  })
}
// 挂载表单
export function addDeployForm(data) {
  return request({
    url: '/api/flowable/form/addDeployForm',
    method: 'post',
    data: data
  })
}
// 上传文件
export function upload(data) {
  return request({
    url: '/api/flowable/form/uploadRichTextImg',
    method: 'post',
    data: data
  })
}
export default { addForm, editForm, del }
